package com.work.mybatis.handler;

import com.work.mybatis.mapper.TypeHandler;

import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;

/**
 * @author 白上二影
 */
public class StringTypeHandler implements TypeHandler<String> {

    /**
     * @param statement st
     * @param i         第几个参数赋值
     * @param value     参数值
     */
    @Override
    public void setParameter(PreparedStatement statement, int i, String value) throws SQLException {
        statement.setString(i,value);

    }

    /**
     * @param resultSet
     * @param columnName
     */
    @Override
    public String getResult(ResultSet resultSet, String columnName) throws SQLException {
        return resultSet.getString(columnName);
    }
}
